<template>
	<view>
		<web-view :src="src"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				src: ''
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init() {
				const page = getCurrentPages()
				let x = page.length - 1
				let options = page[x].options
				// console.log(options)
				let BaseUrl = getApp().globalData.BaseUrl
				let token = uni.getStorageSync('token')
				uni.request({
					url: BaseUrl + '/order/alipay',
					header: {
						'Content-Type': 'application/json',
						'token': token
					},
					data: {
						orderId: options.orderId
					},
					success: (res) => {
						// console.log(res)
						let data = res.data.data
						let action = data.slice(data.indexOf("action") + 8, data.indexOf(">") - 1)
						let value = data.slice(data.indexOf("value") + 7, data.indexOf("}\">") + 1)
						this.src = 'https://vedio.cwiyc.top/index.html?action=' + action + '&value=' + value
						// this.src = 'https://vedio.cwiyc.top/index.html?name=cwiyccc'
					}
				})
			}
		}
	}
</script>

<style>

</style>
